# Hisport驱动测试构建文件

if meson_build
    message('meson build drivers')
    drivers_install_dir = meson.project_build_root() / 'opt/bmc/drivers'
else
    message('bingo build drivers')
    drivers_install_dir = 'opt/bmc/drivers/'
endif
run_command('mkdir', '-p', drivers_install_dir, check: false)

# ABI测试 - 直接包含接口实现文件以确保反射元数据可用
hisport_test_sources = [
    '../../../main.cpp',
    'test_hisport_abi.cpp',
    '../../../../drivers/bus/hisport/interface/i_hisport.cpp',
]

# ABI测试 - 直接包含接口实现文件以确保反射元数据可用
hisport_test_sources = [
    '../../../main.cpp',
    'test_hisport_abi.cpp',
    '../../../../drivers/bus/hisport/interface/i_hisport.cpp',
]

hisport_test = executable(
    'test_hisport_abi',
    hisport_test_sources,
    include_directories: [
        include_dirs,
        '../../../../drivers/bus/hisport',
        '../../../../drivers/internal',
    ],
    dependencies: [
        gtest_dep,
        test_utilities_dep,
        libmcpp_deps,
        internal_dep,
        test_utils_dep,
    ],
    cpp_args: ['-UHAVE_LIBSOC_ADAPTER'],
    link_args: ['-Wl,-rpath,' + meson.project_build_root() + '/opt/bmc/drivers'],
)
test('test_hisport_abi', hisport_test, timeout: 300, suite: 'hisport')